This page last changed on Oct 30, 2007 by aaime.

DataStore

After defining your namespace(s) the next step is to define your DataStore. A DataStore represents a single, physical, source of geographic data. It can consist of one or more featureTypes (or layers). A featureType can be a table (as in a database), a single file (as in a shapefile), a directory (as in a VPF library). The DataStore construct is used so that you do not need to define connection parameters for each and every table in a large database. Instead you define them in the DataStore, and each FeatureType (table) refers to the DataStore that defines those parameters. In the case of Shapefiles, where each file can only contain one FeatureType, this may seem to be a bit of overkill, but to be in line with the rest we define the connection parameters in the Store and the rest in the FeatureType. Each available DataStore is discussed separately, as each has its own parameters and tricks, and you are likely only interested in one or two. But all have a few common parameters.

To define a new DataStore, click on Stores from the main Data page,and then hit the New button. This will take you to a page like the following:

In the DataStore Description drop down box there will appear all the currently supported DataStores, from which you can select the type of DataStore you want to create. Note that the default GeoServer installation will not include all the possible DataStores. For example the oracle datastore(s) will only show up when the proper oracle jars are in the lib/ section, as we can not legally distribute these with GeoServer. There are also a number of DataStores available in the DataStore Extras download section (make sure your version of Geoserver is compatible with the datastores you download!), that for some reason or another are not quite ready for the default GeoServer installation. Many will be once they are well tested. Others are the latest versions of common DataStores, we make these available so users need not go through a whole upgrade procedure, they can just drop in the latest jar for their datastore. When the jars are installed correctly in the lib/ directory (each should have instructions on how to do this), it will show up in the drop down box. You just need to select it, and then fill in the appropriate parameters.

You also need to define a DataStore ID. This is just used internally, and should be unique.

After selecting the DataStore ID and the type of DataStore you would like to create then hit the New button and you will be taken to a page that looks more or less like the following:

We will examine each DataStore in turn (this one happens to be MySQL), for now we just want to point out the three common fields that all DataStores have:

Enabled allows you to 'turn off' access to the store, and all featureTypes defined in it. This can be useful for testing purposes, so GeoServer does not load everything up.

Namespace is a drop down box of the possible namespaces. You should have defined your namespace, so select that one. One thing to note is that there is a slight limitation with GeoServer here, namely that you can not define two featureTypes from the same DataStore in different namespaces. If you wish to do that the recommend way is to define two DataStores, with exactly the same connection parameters, but different DataStore ids andnamespaces. We know, it's a bit hacky, but it's the best we've got, and changing this around requires a lot of changes in GeoTools (though it should be possible if we get the arbitrary mapping of schemas correct).

Description is mostly used internally, so that other admins can get extra information about the DataStore.

As for the additional fields, they depend on the format of the data you wish to server. GeoServer 1.3 comes with support for four data types by default. PostGIS was the first datastore offered with GeoServer, and remains the best supported and most tested. PostGIS is based on the advanced open source database PostgreSQL, with extensions to handle spatial types and operations. It conforms to the OGC's Simple Features for SQL specification, completely compliant as of version 1.0. Shapefiles were the first additional datastore supported, allowing users to quickly get GeoServer running. We recommend using a real transactional database, but do offer the ability to serve and do transactions on shapefiles in GeoServer directly, with solid performance. Note that there is also a new shapefile datastore that builds and uses a spatial index, available as a DataStore Extra. Oracle is also available, though it needs an extra jar in order to run, as we are not allowed to redistribute the jar. ArcSDE is additionally supported, and 1.3 brought a number of bug fixes to get it actually working decently well. Proprietary datastores such as Oracle and ArcSDE are harder for us to support, since they can not be easily downloaded, installed and tested (and it gets even nastier when you get into different versions). The GeoServer project will do all that we can to support them, but if you require real support then we recommend you hire someone to do consulting on GeoServer, see the section on Commercial Support.

We have also started offering DataStore Extras. This a section of the download page where we offer new and experimental DataStores. DataStores are written to be completely pluggable, you just put the appropriate jar files in the lib/ directory of GeoServer, and they are available at the next GeoServer start up. This means that we can offer new DataStores, such as MySQL and IndexedShapefile, for advanced users to test out, as well as easily make upgrades to older DataStores available. For example there were a number of speed improvements to thePostGIS datastore in 1.3, but instead of downloading the whole new server, you could just download the jar into your 1.3.0 version, and get all the improvements.

From here we recommend that you follow the configuration of the DataStore that you are most interested in. Please click on one of the following to take you to the right section in 3 DataStores configuration details page:

Shapefile DataStore
Indexed Shapefile
PostGIS DataStore
DB2 DataStore
Oracle DataStore
GEOTDOC:ArcSDE DataStore

Beta DataStores
MySQL DataStore
VPF DataStore
WFS DataStore
MapInfo DataStore


datastore-editor.jpg (image/jpeg)
datastore-new.jpg (image/jpeg)
Document generated by Confluence on Jan 16, 2008 23:27